import 'package:fate_blind_box/network/http_request.dart';
import 'package:fate_blind_box/ui/Home/activity/act_list_model.dart';
import 'package:fate_blind_box/utils/provider.dart';
import 'package:get/get_state_manager/src/simple/get_controllers.dart';

class HomeActListController extends GetxController {
  List todayList = [];
  List futureList = [];
  List pastList = [];
  String tabListViewId ='tabListViewId';

  getTabListData() async{
    var res = await HttpRequest.request('member/activity/querys',
        params: {'memberId': Provider.memberId});
    if (res is Map) {
      Map resMap = res as Map;
      ActListModel resModel = ActListModel.fromJson(resMap);
      todayList.addAll(resModel.data?.todayGrandCeremony ?? []);
      futureList.addAll(resModel.data?.futurePopular ?? []);
      pastList.addAll(resModel.data?.previousReview ?? []);
      update([tabListViewId]);
    }
  }
}
